package com.har.modules.web.controller;

import com.har.common.utils.PageUtils;
import com.har.common.utils.R;
import com.har.modules.web.entity.extend.LoanHtModel;
import com.har.modules.web.entity.extend.PolicyModel;
import com.har.modules.web.service.LoanHtService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;



/**
 * 华泰保险
 *
 * @author maoruidd
 * @email 
 * @date 2018-07-26 09:08:17
 */
@RestController
@RequestMapping("/loanht")
public class LoanHtController {
    @Autowired
    private LoanHtService loanHtService;


    /**
     * 列表
     */
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = loanHtService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody LoanHtModel loanHtModel){
        loanHtService.addOrder(loanHtModel);

        return R.ok();
    }


    /**
     * 出单详细信息
     * @param request
     * @param response
     * @return
     */
    @RequestMapping("/info")
    public R info(HttpServletRequest request, HttpServletResponse response){
        PolicyModel policyModel=loanHtService.policy(null);
        
        return R.ok().put("data",policyModel);
    }
}
